var express = require("express");

var app = express();

app.get("/",function(req,res){
    res.writeHead(200, {"Content-type": "text/html;charset=UTF-8"});            
    res.end("你好");
});
app.get("/haha",function(req,res){
    res.writeHead(200, {"Content-type": "text/html;charset=UTF-8"});            
    res.end("这是haha页面");
});
app.get(/^\/student\/([\d]{10})$/,function(req,res){
    res.send("学生信息，学号为" + req.params[0]);   // params表示匹配到的第一个数组
});
app.get("/teacher/:gonghao",function(req,res){
    res.send("老师信息工号：" + req.params.gonghao);   
});

app.listen(3000);